#include "ShieldProcessor.h"
#include "PlayerPlane.h"
#include "ShieldBuff.h"
#include "MainLayer.h"
#include "InputLayer.h"


ShieldProcessor::ShieldProcessor(void)
{
	_time = 0;
}


ShieldProcessor::~ShieldProcessor(void)
{
}


void ShieldProcessor::process( PlayerPlane* plane, MainLayer* mainLayer )
{
	ShieldBuff* buff = ShieldBuff::create();
	buff->setTimeMax(_time);
	buff->setPlane(plane);
	buff->setId(getId());

	mainLayer->getInputLayer()->getStateBar()->addBuff(buff);
}

void ShieldProcessor::parseXml( xml_node node )
{
	float time = node.child("Time").text().as_float();
	_time = time;
}
